package com.zbw.service.impl;

import com.zbw.domain.BookCategory;
import com.zbw.mapper.BookCategoryMapper;
import com.zbw.service.IBookCategoryService;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class BookCategoryServiceImpl implements IBookCategoryService {

    @Resource
    private BookCategoryMapper bookCategoryMapper;

    @Override
    public List<BookCategory> selectBookCategoryByPageNum(int pageNum) {
        Page<BookCategory> page = new Page<>(pageNum,5);
        bookCategoryMapper.selectPage(page,null);
        List<BookCategory> list = page.getRecords();
        return list;
    }

    @Override
    public int deleteBookCategoryById(int bookCategoryId) {
        return bookCategoryMapper.deleteById(bookCategoryId);
    }
}
